package cn.ronghui.project.types.enums;

import lombok.Getter;

@Getter
public enum RoomStatusEnumVO {
    AVAILABLE("free","空闲"),
    RENTED("rented","已租用"),
    REPAIR("repair","维修中"),
    ;
    private String code;
    private String info;

    RoomStatusEnumVO(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public static RoomStatusEnumVO getRoomStatusEnumVO(String value){
        switch (value){
            case "空闲":
                return AVAILABLE;
            case "已租用":
                return RENTED;
            case "维修中":
                return REPAIR;
            default:
                throw new RuntimeException("参数错误");

        }
    }
}
